Repository navigation
feat: a sampling CPU profile of the run, with the cpu-profile feature - #31
Merged
Merged
Conversation
Moved from instagram-rs. `cpu_profile::start_from_env` (`PROFILE_CPU=1`) or `cpu_profile::start` profiles every thread with pprof; `cpu_profile::save` writes a flamegraph (`CPU_PROFILE.svg`) and a pprof profile (`CPU_PROFILE.pb`) to the default key-value store and logs the share of each group of crates and the top functions by self time. The Actor names its own crate, which is a group of its own. Linux only, behind the `cpu-profile` feature; CI checks and tests it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0148RYR4BTGyCYHENSRZjC3S
- The in-process re-open of a deleted alias went through `Services`, which hands back the instance it already opened (as `StorageInstanceManager` does in JS), so the backend never resolved it again. Ask the backend. - The replaced declared storage is remembered on the platform, so the off-platform check now asserts the mapping is unchanged instead of absent. - The deleted default dataset is no longer the storage expected to exist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0148RYR4BTGyCYHENSRZjC3S (cherry picked from commit 519338e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This moves instagram-rs's CPU profiler (
src/cpu_profile.rs) into the SDK asapify::cpu_profile, behind the optionalcpu-profilefeature (Linux; pprof with the framehop unwinder). The default build gets no new dependencies.cpu_profile::start_from_env(actor_crate)starts at process start whenPROFILE_CPU=1. Call it before the runtime starts its threads.cpu_profile::start(actor_crate)starts it from anywhere, for example when the input asks.PROFILE_CPU_HZsets the frequency.cpu_profile::save()savesCPU_PROFILE.svg(flamegraph) andCPU_PROFILE.pb(pprof) to the default key-value store. It also logs the share of each group of crates (TLS, HTTP, JSON, HTML, Crawlee & SDK…) and the top functions by self time.env!("CARGO_PKG_NAME"). That crate's samples get their own "This Actor" group.cargo test, which is red on master because of the twotests/storage.rstests from fix: re-open a deleted storage of an alias, as JS does #28 (see feat: charge an event listed more than once as many times per item, with one call #29).This lets instagram-rs delete
src/cpu_profile.rs(about 900 lines) and itspprofandbacktracedependencies. It would callapify::cpu_profile::{start_from_env, start, save}withenv!("CARGO_PKG_NAME"). ItsCPU_BUSYtest lock can go too.Generated by Claude Code